The volume method returns a numeric volume for a given index.
var volume(index);
index
Numeric index for which to retrieve the value.
Returns a numeric volume value if index is valid, otherwise, returns null.
The following example demonstrates the use of volme() method.
function calculate(beginIndex, endIndex)
{
//get the TimeSeries object instance for the symbol to which the study is attached to
var timeSeries = Chart.getTimeSeriesData(this.getAttachedSymbol());
if(timeSeries != null)
{
//retrieve last Value
if(timeSeries.count() > 0)
{
var lastVolumeValue = timeSeries.volume(timeSeries.count() - 1);
}
}
}
Copyright © 2006-2009 ActiveTick LLC